A bunch of uninteresting changes to make icc (and presumably other
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 16 Mar 2005 17:51:53 +0000 (17:51 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 16 Mar 2005 17:51:53 +0000 (17:51 +0000)
edgfe-based tools) whine less.

coastexp: fix bounds violation on monthString
delgpl: fix error text on fatal()
geoniche: tweak terminator
google: make seial an int, not long.
gpx: include xmlgeneric
lowrance: fix signedness writing waypoint count
mapsource make le_f(read|write)64 explictly void
nmea: add gratituous initialization
overlay: explicitly zero zome values
position: bloat 'nop' functions to eliminate need for cast.
shape: close->SHPClose.   misc warning fixes
tpg: include ctype
xmlgeneric.h: add many protos.

13 files changed:
gpsbabel/coastexp.c
gpsbabel/delgpl.c
gpsbabel/geoniche.c
gpsbabel/google.c
gpsbabel/gpx.c
gpsbabel/lowranceusr.c
gpsbabel/mapsource.c
gpsbabel/nmea.c
gpsbabel/overlay.c
gpsbabel/position.c
gpsbabel/shape.c
gpsbabel/tpg.c
gpsbabel/xmlgeneric.h

index 370e09623e0952851f38553e936c8b04c5b0d38c..e262285dfb279e8e53aebdaf5ce6fb2e28920693 100755 (executable)
@@ -250,7 +250,7 @@ ce_cdata(void *dta, const XML_Char *s, int len)
                                        yearString[4] = '\0';
                                        t.tm_year = atoi(yearString) - 1900;
                                        strncpy(monthString, currentMark->created+4, 2);
-                                       monthString[3] = '\0';
+                                       monthString[2] = '\0';
                                        t.tm_mon = atoi(monthString) - 1;
                                        strncpy(dayString, currentMark->created+6, 2);
                                        dayString[2] = '\0';
index f9d68c23344cdb7e447f34823ee1a66020b5da65..22c34b0fddae0c82396b56ee7f7a09d9abb36715 100644 (file)
@@ -46,7 +46,7 @@ gpl_rd_init(const char *fname)
 {
        gplfile_in = xfopen(fname, "rb", MYNAME);
        if (sizeof(struct gpl_point) != 56) {
-               fatal(MYNAME, ": gpl_point is %d instead of 56.\n", 
+               fatal(MYNAME ": gpl_point is %d instead of 56.\n", 
                                sizeof(struct gpl_point));
        }
 }
index bd1041856ed2d060008cd5388fe44adbfc6538f5..c73ca8dbb1da76fe19846dd491a510b8506cd769 100644 (file)
@@ -43,7 +43,7 @@ arglist_t Args[] = {
            "Database name (filename)", NULL, ARGTYPE_STRING },
        {"category", &Arg_category,
            "Category name (Cache)", NULL, ARGTYPE_STRING },
-       {0, 0, 0, 0 }
+       {0, 0, 0, 0, 0 }
 };
 
 #define        ARG_FREE(X) do { if (X) { xfree(X); X = NULL; } } while (0)
index e5879360d1fbdbb689f9291ca485f04fe3ba4cd0..ffdc918ea1ed79fb232d5157237c578918ee5525 100644 (file)
@@ -25,7 +25,7 @@ static char *script = NULL;
 
 FILE *fd;
 
-static long serial = 0;
+static int serial = 0;
 
 #define MYNAME "google"
 #define MY_CBUF 4096
index 2cd12d0d16e5d708a200c05b8b8700bdc11d5d33..fd6a93a1d9386a2f947a6f4888361a0c73f6c884 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "defs.h"
+#include "xmlgeneric.h"
 #ifndef NO_EXPAT
        #include <expat.h>
        static XML_Parser psr;
index cd996007ed5a36e83843a1b42675e5b57c8cc125..e0fac3c955d53e0273a8a0dd86dd1ef0b08e211d 100644 (file)
@@ -288,7 +288,7 @@ lowranceusr_waypt_pr(const waypoint *wpt)
        int alt = wpt->altitude;
 
        /* our personal waypoint counter */
-       my_fwrite2(&waypt_out_count, file_out);
+       my_fwrite2((short *) &waypt_out_count, file_out);
        waypt_out_count++;
 
        Lat = lat_deg_to_mm(wpt->latitude);
index a7a2df5ac40644b6798e0fb812a7ecac8c83fa41..83871c700cf5700bc53c7d72f3195ed40d671f31 100644 (file)
@@ -95,6 +95,7 @@ arglist_t mps_args[] = {
  * A wrapper to ensure the doubles we fwrite are in correct endianness.
  */
 
+void
 le_fwrite64(void *ptr, int sz, int ct, FILE *stream)
 {
        unsigned char cbuf[8];
@@ -107,6 +108,7 @@ le_fwrite64(void *ptr, int sz, int ct, FILE *stream)
        fwrite(cbuf, 8, 1, stream);
 }
 
+void
 le_fread64(void *ptr, int sz, int ct, FILE *stream)
 {
        unsigned char cbuf[8];
index b42fa24f59ac68bdd3db48d3a5f6f50bfc65a970..c5bba8ecb790fc7a06834d5b76faa541c122866d 100644 (file)
@@ -454,5 +454,6 @@ ff_vecs_t nmea_vecs = {
        nmea_wr_deinit, 
        nmea_read,
        nmea_write,
+       NULL,
        NULL
 };
index 60fd403e1df66069b72d9df9b51d99b2a7088463..aac9e5cf3edb989996238b31cf6e108249d62cef 100644 (file)
@@ -223,7 +223,7 @@ void ovl_read(void)
   char   *pstr;
   int     keyw,i;
   double  rwert;
-  route_head *route_head;
+  route_head *route_head = NULL;
   waypoint   *wpt;
   int      sym_cnt;
 
@@ -568,10 +568,12 @@ void symbol_deinit(const route_head *hd)
   queue *elem, *tmp;
   waypoint *waypointp;
   int i;
-  double lat1, lon1, lat2, lon2;
+  double lat1,lon1,lat2,lon2;
   double lats,lons,late,lone;
   double dist,d,dd;
 
+  lat1 = lon1 = lat2 = lon2 = 0.0;
+  lats = lons = late = lone = 0.0;
   dist = 0.0;
   i = 0;
   QUEUE_FOR_EACH(&(hd->waypoint_list), elem, tmp)
index 85125786744810f0f7448ef269489a4cf27dfe21..dbf54cd57690fdfcfa993da8337e917782e5a151 100644 (file)
@@ -221,7 +221,13 @@ position_process_route(const route_head * rh) {
 }
 
 static void 
-position_noop(){
+position_noop_w(const waypoint *w)
+{
+}
+
+static void 
+position_noop_t(const route_head *h)
+{
 }
 
 void position_process() 
@@ -231,8 +237,8 @@ void position_process()
        if (i)
                position_runqueue(&waypt_head, i, wptdata);
        
-       route_disp_all(position_process_route, position_noop, position_noop);
-       track_disp_all(position_process_route, position_noop, position_noop);
+       route_disp_all(position_process_route, position_noop_t, position_noop_w);
+       track_disp_all(position_process_route, position_noop_t, position_noop_w);
 }
 
 void
index 14a35318a5064ab3f33685eb3e651378556b320a..4294e817256cb4831f50d6c895ad20cec30e87ad 100644 (file)
@@ -100,7 +100,7 @@ my_read(void)
 void
 my_rd_deinit(void)
 {
-       close (ihandle);
+       SHPClose (ihandle);
 }
 
 void
@@ -129,7 +129,7 @@ my_write_wpt(const waypoint *wpt)
 }
 
 void
-poly_init()
+poly_init(const route_head *h)
 {
        int ct = route_waypt_count();
        polybufx = xcalloc(ct, sizeof(double));
@@ -148,7 +148,7 @@ poly_point(const waypoint *wpt)
 }
 
 void
-poly_deinit()
+poly_deinit(const route_head *h)
 {
        SHPObject *shpobject;
        shpobject = SHPCreateSimpleObject(SHPT_ARC, route_waypt_count(), 
@@ -185,6 +185,9 @@ my_write(void)
                        }
                        route_disp_all(poly_init, poly_deinit, poly_point);
                        break;
+               case rtedata:
+                       fatal(MYNAME ":Routes are not supported\n");
+                       break;
        }
 }
 
@@ -197,5 +200,6 @@ ff_vecs_t shape_vecs = {
        my_wr_deinit,
        my_read,
        my_write,
+       NULL,
        NULL
 };
index e9e5a1a57b891f15e5cfd067c945124329476c73..9eb3696b593bcc474ad4bb90f03b303383b74267 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "defs.h"
 #include <string.h>
+#include <ctype.h>
 #include "jeeps/gpsmath.h" /* for datum conversions */
 
 #define MYNAME "TPG"
index ec66ae0d3d998057ad31c24924883d80cb392454..35758b0125d9d90983e0cdfb6caef7181ce9a4ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Header for our common utilities for XML-based formats.
 
-    Copyright (C) 2004 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2004, 2005 Robert Lipe, robertlipe@usa.net
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -37,11 +37,22 @@ typedef struct xg_tag_mapping {
 
 
 void write_xml_entity(FILE *ofd, const char *indent,
-                 const char *tag, const char *value);
+               const char *tag, const char *value);
+void write_xml_entity_begin0(FILE *ofd, const char *indent,
+               const char *tag);
+void write_xml_entity_begin1(FILE *ofd, const char *indent, const char *tag, 
+               const char *attr1, const char *attrval1);
+void write_xml_entity_begin2(FILE *ofd, const char *indent, const char *tag, 
+               const char *attr1, const char *attrval1, 
+               const char *attr2, const char *attrval2);
+void write_xml_entity_end(FILE *ofd, const char *indent, const char *tag);
 
 void write_optional_xml_entity(FILE *ofd, const char *indent,
-                 const char *tag, const char *value);
+               const char *tag, const char *value);
 void xml_write_time(FILE *ofd, const time_t timep, char *elname);
+void xml_fill_in_time(char *time_string, const time_t timep, 
+               int long_or_short);
+void write_xml_header(FILE *ofd);
 
 void xml_init(const char *fname, xg_tag_mapping *tbl);
 void xml_read(void);